package com.ccl.bigevent.mapper;

import com.ccl.bigevent.pojo.Article;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Title: ArticleMapper
 * @Author ccl
 * @Package IntelliJ IDEA
 * @Date 2024/10/26 10:20
 * @description:
 */
@Mapper
public interface ArticleMapper {

    List<Article> list(Integer userId, Integer categoryId, String state);

    @Insert("insert into article (" +
            " title, content, cover_img, `state`, category_id, create_user, create_time, update_time)" +
            " values (" +
            "#{title}, #{content}, #{coverImg}, #{state}, #{categoryId}, #{createUser}, now(), now())")
    void add(Article article);
}
